3.4 \(\int \cot (c+d x) (a+i a \tan (c+d x)) (A+B \tan (c+d x)) \, dx\)

Optimal. Leaf size=40 \[ a x (B+i A)+\frac{a A \log (\sin (c+d x))}{d}-\frac{i a B \log (\cos (c+d x))}{d} \]

[Out]

a*(I*A + B)*x - (I*a*B*Log[Cos[c + d*x]])/d + (a*A*Log[Sin[c + d*x]])/d

________________________________________________________________________________________

Rubi [A]  time = 0.0711095, antiderivative size = 40, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 30, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.1, Rules used = {3589, 3475, 3531} \[ a x (B+i A)+\frac{a A \log (\sin (c+d x))}{d}-\frac{i a B \log (\cos (c+d x))}{d} \]

Antiderivative was successfully verified.

[In]

Int[Cot[c + d*x]*(a + I*a*Tan[c + d*x])*(A + B*Tan[c + d*x]),x]

[Out]

a*(I*A + B)*x - (I*a*B*Log[Cos[c + d*x]])/d + (a*A*Log[Sin[c + d*x]])/d

Rule 3589

Int[(((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]))/((a_.) + (b_.)*tan[(e_.)
 + (f_.)*(x_)]), x_Symbol] :> Dist[(B*d)/b, Int[Tan[e + f*x], x], x] + Dist[1/b, Int[Simp[A*b*c + (A*b*d + B*(
b*c - a*d))*Tan[e + f*x], x]/(a + b*Tan[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f, A, B}, x] && NeQ[b*c - a
*d, 0]

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3531

Int[((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])/((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[((a*c +
 b*d)*x)/(a^2 + b^2), x] + Dist[(b*c - a*d)/(a^2 + b^2), Int[(b - a*Tan[e + f*x])/(a + b*Tan[e + f*x]), x], x]
 /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[a*c + b*d, 0]

Rubi steps

\begin{align*} \int \cot (c+d x) (a+i a \tan (c+d x)) (A+B \tan (c+d x)) \, dx &=(i a B) \int \tan (c+d x) \, dx+\int \cot (c+d x) (a A+a (i A+B) \tan (c+d x)) \, dx\\ &=a (i A+B) x-\frac{i a B \log (\cos (c+d x))}{d}+(a A) \int \cot (c+d x) \, dx\\ &=a (i A+B) x-\frac{i a B \log (\cos (c+d x))}{d}+\frac{a A \log (\sin (c+d x))}{d}\\ \end{align*}

Mathematica [A]  time = 0.0557537, size = 49, normalized size = 1.22 \[ \frac{a A (\log (\tan (c+d x))+\log (\cos (c+d x)))}{d}+i a A x-\frac{i a B \log (\cos (c+d x))}{d}+a B x \]

Antiderivative was successfully verified.

[In]

Integrate[Cot[c + d*x]*(a + I*a*Tan[c + d*x])*(A + B*Tan[c + d*x]),x]

[Out]

I*a*A*x + a*B*x - (I*a*B*Log[Cos[c + d*x]])/d + (a*A*(Log[Cos[c + d*x]] + Log[Tan[c + d*x]]))/d

________________________________________________________________________________________

Maple [A]  time = 0.059, size = 56, normalized size = 1.4 \begin{align*} iAax+{\frac{iAac}{d}}-{\frac{iBa\ln \left ( \cos \left ( dx+c \right ) \right ) }{d}}+aBx+{\frac{Aa\ln \left ( \sin \left ( dx+c \right ) \right ) }{d}}+{\frac{Bac}{d}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(d*x+c)*(a+I*a*tan(d*x+c))*(A+B*tan(d*x+c)),x)

[Out]

I*A*a*x+I/d*A*a*c-I*a*B*ln(cos(d*x+c))/d+a*B*x+a*A*ln(sin(d*x+c))/d+1/d*B*a*c

________________________________________________________________________________________

Maxima [A]  time = 1.71528, size = 66, normalized size = 1.65 \begin{align*} \frac{2 \,{\left (d x + c\right )}{\left (i \, A + B\right )} a -{\left (A - i \, B\right )} a \log \left (\tan \left (d x + c\right )^{2} + 1\right ) + 2 \, A a \log \left (\tan \left (d x + c\right )\right )}{2 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)*(a+I*a*tan(d*x+c))*(A+B*tan(d*x+c)),x, algorithm="maxima")

[Out]

1/2*(2*(d*x + c)*(I*A + B)*a - (A - I*B)*a*log(tan(d*x + c)^2 + 1) + 2*A*a*log(tan(d*x + c)))/d

________________________________________________________________________________________

Fricas [A]  time = 1.38504, size = 103, normalized size = 2.58 \begin{align*} \frac{-i \, B a \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + A a \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} - 1\right )}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)*(a+I*a*tan(d*x+c))*(A+B*tan(d*x+c)),x, algorithm="fricas")

[Out]

(-I*B*a*log(e^(2*I*d*x + 2*I*c) + 1) + A*a*log(e^(2*I*d*x + 2*I*c) - 1))/d

________________________________________________________________________________________

Sympy [B]  time = 2.49193, size = 92, normalized size = 2.3 \begin{align*} \operatorname{RootSum}{\left (z^{2} d^{2} + z \left (- A a d + i B a d\right ) - i A B a^{2}, \left ( i \mapsto i \log{\left (- \frac{2 i i d}{i A a e^{2 i c} - B a e^{2 i c}} + \frac{i A + B}{i A e^{2 i c} - B e^{2 i c}} + e^{2 i d x} \right )} \right )\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)*(a+I*a*tan(d*x+c))*(A+B*tan(d*x+c)),x)

[Out]

RootSum(_z**2*d**2 + _z*(-A*a*d + I*B*a*d) - I*A*B*a**2, Lambda(_i, _i*log(-2*_i*I*d/(I*A*a*exp(2*I*c) - B*a*e
xp(2*I*c)) + (I*A + B)/(I*A*exp(2*I*c) - B*exp(2*I*c)) + exp(2*I*d*x))))

________________________________________________________________________________________

Giac [B]  time = 1.44866, size = 104, normalized size = 2.6 \begin{align*} -\frac{i \, B a \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + 1 \right |}\right ) + i \, B a \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 1 \right |}\right ) - A a \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) \right |}\right ) + 2 \,{\left (A a - i \, B a\right )} \log \left (\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + i\right )}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)*(a+I*a*tan(d*x+c))*(A+B*tan(d*x+c)),x, algorithm="giac")

[Out]

-(I*B*a*log(abs(tan(1/2*d*x + 1/2*c) + 1)) + I*B*a*log(abs(tan(1/2*d*x + 1/2*c) - 1)) - A*a*log(abs(tan(1/2*d*
x + 1/2*c))) + 2*(A*a - I*B*a)*log(tan(1/2*d*x + 1/2*c) + I))/d